package testjava.grammar;

public class TestInnerClass {
	private String field1;
	private static String field5;

	static class StaticInnerClass {
		private String si_field1;
		private static String si_field5;

		public static void staticMethod() {
			TestInnerClass app = new TestInnerClass();
			InnerClass inner = app.new InnerClass();
			// InnerClass inner2 = new InnerClass();
			inner.i_field1 = "";

			app.field1 = "";
			TestInnerClass.field5 = "";
		}

		public void method() {
			TestInnerClass app = new TestInnerClass();
			InnerClass inner = app.new InnerClass();
			// InnerClass inner2 = new InnerClass();
			inner.i_field1 = "";

			app.field1 = "";
			TestInnerClass.field5 = "";
		}

	}

	class InnerClass {
		private String i_field1;

		// private static String i_filed5;

		// public static void staticMethod() {
		//
		// }

		public void method() {
			TestInnerClass.StaticInnerClass staticInner = new TestInnerClass.StaticInnerClass();
			StaticInnerClass staticInner2 = new StaticInnerClass();
			staticInner.si_field1 = "";
			StaticInnerClass.si_field5 = "";

			TestInnerClass app = new TestInnerClass();
			app.field1 = "";
			TestInnerClass.field5 = "";
		}
	}

	public static void staticMethod() {
		TestInnerClass app = new TestInnerClass();
		InnerClass inner = app.new InnerClass();
		inner.i_field1 = "";

		TestInnerClass.StaticInnerClass staticInner = new TestInnerClass.StaticInnerClass();
		staticInner.si_field1 = "";
		StaticInnerClass.si_field5 = "";
	}

	public void method() {
		InnerClass inner = new InnerClass();
		inner.i_field1 = "";

		TestInnerClass.StaticInnerClass staticInner = new TestInnerClass.StaticInnerClass();
		staticInner.si_field1 = "";
		StaticInnerClass.si_field5 = "";
	}

	public void localInnerClass() {
		String lm_field1 = "";
		final String lm_field2 = "";
		class LocalInner {
			String li_field1 = "";
			final String li_field2 = "";

			public void method() {
				li_field1 = "";
				field5 = "";
				// lm_field1="";
				if (lm_field2.length() > 0) {

				}
			}
			// public static void staticMethod(){
			//				 
			// }
		}
		abstract class LocalInner2 {

		}
		final class LocalInner3 {

		}
		LocalInner li = new LocalInner();
		li.li_field1 = "";
		if (li.li_field2.length() > 0) {

		}
	}

	public void anonymousInnerClass() {
		System.out.println(new Runnable() {

			public void run() {
				// TODO Auto-generated method stub

			}

		});

	}

	public static void main(String[] args) {
		TestInnerClass app = new TestInnerClass();
		InnerClass inner = app.new InnerClass();
	}
}
